package cn.yuanqiao.web.controller.monitor;

import cn.yuanqiao.archive.task.util.HttpClientUtil;
import com.alibaba.fastjson2.JSONObject;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import cn.yuanqiao.common.core.domain.AjaxResult;

/**
 * 服务器监控
 *
 * @author ruoyi
 */
@RestController
@RequestMapping("/system/monitor/server")
public class ServerController
{
    @GetMapping()
    public AjaxResult getInfo() throws Exception
    {
        /*Server server = new Server();
        server.copyTo();
        return AjaxResult.success(server);*/
        String s = HttpClientUtil.doGet("http://10.196.113.252:26888/prod-api/monitor/server");
        JSONObject server = JSONObject.parseObject(s);
        return AjaxResult.success(server);
    }
}
